﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;

namespace KDG.FoldersSize
{
    /// <summary>
    /// Interaction logic for AnimScan.xaml
    /// </summary>
    public partial class AnimScan : UserControl
    {
        public AnimScan() { this.InitializeComponent(); }

        public string StatusText { get { return textBlock.Text; } set { textBlock.Text = value; } }
        public void BeginAnim()
        {
            (this.Resources["StoryboardAnim"] as Storyboard).Begin();
        }
        public void StopAnim()
        {
            (this.Resources["StoryboardAnim"] as Storyboard).Stop();
        }

        new public Visibility Visibility
        {
            get { return base.Visibility; }
            set
            {
                base.Visibility = value;
                if (value == Visibility.Visible)
                    BeginAnim();
                else
                    StopAnim();
            }
        }
    }
}